package chixing.day09.interfacelean;

public class Computer {
    private Mainboard mainboard;

    public Computer(Mainboard mainboard) {
        this.mainboard = mainboard;
    }

    public void openPC(){
        mainboard.run();
    }
    public void closePC(){
        mainboard.close();
    }



    public static void main(String[] args) {
        VideoCard videoCard = new DmengVideoCard();
        Cpu interCpu =  new InterCpu();
        Mainboard mainboard = new Mainboard(videoCard,interCpu);

        Computer computer = new Computer(mainboard);
        computer.openPC();
        computer.closePC();
    }

}
